From: Georges Basile Stavracas Neto Date: Fri, 5 Jun 2020 05:23:53 +0000 (-0300) Subject: workspacesView: Add API to hide workspaces without destroying X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~550 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a29e002a41a03bb3d2220d2de79c090e0717fa10;p=gnome-shell.git workspacesView: Add API to hide workspaces without destroying This will be used by the next commit to hide workspaces when ViewSelector switches to the search page, without destroying the workspaces so their state is preserved. Part-of: --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 99a1e6597..9e1dccb0f 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -404,6 +404,7 @@ class WorkspacesDisplay extends St.Widget { this._syncWorkspacesActualGeometry(); }); + this._primaryVisible = true; this._primaryIndex = Main.layoutManager.primaryIndex; this._workspacesViews = []; @@ -570,6 +571,18 @@ class WorkspacesDisplay extends St.Widget { return this._getPrimaryView().navigate_focus(from, direction, false); } + setPrimaryWorkspaceVisible(visible) { + if (this._primaryVisible === visible) + return; + + this._primaryVisible = visible; + + const primaryIndex = Main.layoutManager.primaryIndex; + const primaryWorkspace = this._workspacesViews[primaryIndex]; + if (primaryWorkspace) + primaryWorkspace.visible = visible; + } + animateToOverview(fadeOnPrimary) { this.show(); this._updateWorkspacesViews(); @@ -672,6 +685,8 @@ class WorkspacesDisplay extends St.Widget { this._workspacesViews.push(view); Main.layoutManager.overviewGroup.add_actor(view); } + + this._workspacesViews[this._primaryIndex].visible = this._primaryVisible; } _getMonitorIndexForEvent(event) {